//
//  ZZCPayPasswordController.m
//  ZZC-Finance
//
//  Created by mac on 2017/5/25.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "ZZCPayPasswordController.h"
#import "ZZCLookPayPasswordController.h"
#import "ZZCChangePayPwdController.h"

@interface ZZCPayPasswordController ()
@property (weak, nonatomic) IBOutlet UIView *alterPayPasswordView;
@property (weak, nonatomic) IBOutlet UIView *lookPayPasswordView;
@property(nonatomic,strong) GRBkeyTextField * safeTextField;
@property(nonatomic,strong) GRBkeyTextField * safeInputTextField;
@property(nonatomic,strong) GRBsafeKeyBoard * board;
@end

@implementation ZZCPayPasswordController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"支付密码";
    [self addAGestureToView];
    IQKeyboardManager *iq = [IQKeyboardManager sharedManager];
    iq.enableAutoToolbar = NO;
}

//给view添加手势
- (void)addAGestureToView {
    //修改支付密码
    self.alterPayPasswordView.userInteractionEnabled = YES;
    UITapGestureRecognizer *alterTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(alterTapClick)];
    [self.alterPayPasswordView addGestureRecognizer:alterTap];
    //找回支付密码
    self.lookPayPasswordView.userInteractionEnabled = YES;
    UITapGestureRecognizer *lookPayTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lookPayTapClick)];
    [self.lookPayPasswordView addGestureRecognizer:lookPayTap];
}

#pragma mark - 监听点击事件
    //修改支付密码
- (void)alterTapClick {
    ZZCChangePayPwdController *vc = [ZZCChangePayPwdController new];
    [self.navigationController pushViewController:vc animated:YES];
//    self.board = [GRBsafeKeyBoard GRB_showSafeInputKeyBoard];
//    __weak typeof(self)weakSelf = self;
//    self.board.GRBsafeKeyFinish=^(NSString * passWord){
//        
//        if (passWord.length==6) {
//            
//            [weakSelf.board GRB_endKeyBoard];
//            ZZCLog(@"你输入的密码为---%@",passWord);
//            //在这里判断密码是否正确
//            if (YES) {
//                ZZCLog(@"支付密码设置成功");
//            }else {
//                ZZCLog(@"支付密码设置失败");
//            }
//        }
//        
//    };
//    self.board.GRBsafeKeyClose=^{
//        
//        [weakSelf.board GRB_endKeyBoard];
//        
//    };
//    
//    self.board.GRBsafeKeyForgetPassWord=^{
//        ZZCLog(@"点击忘记密码了");
//        [weakSelf lookPayTapClick];
//    };
}
    //找回支付密码
- (void)lookPayTapClick{
    ZZCLookPayPasswordController *look = [ZZCLookPayPasswordController new];
    [self.navigationController pushViewController:look animated:YES];
}


- (IBAction)certainClick {
    ZZCLog(@"确定");
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
